<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="../static/static/css/font.css">
    <link rel="stylesheet" href="../static/static/css/weadmin.css">
    <script src="../static/lib/layui/layui.js" charset="utf-8"></script>
    <script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js" charset="utf-8"></script>
</head>
<body class="login-bg">
<div class="login">
    <div class="message">仟禧集团管理登陆</div>
    <div id="darkbannerwrap"></div>

    <form action="/portal/userLogin" method="get" class="layui-form">
        <input name="username" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >
        <hr class="hr15">
        <input name="password" lay-verify="required" placeholder="密码"  type="password" class="layui-input">
        <hr class="hr15">
        <input class="loginin" value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
        <hr class="hr20" >
    </form>
    <script>
        layui.use('form', function(){
            var form = layui.form;
            form.on('submit(login)', function(data){
                var $ = layui.jquery
                var userName = data.field.username
                var userPass = data.field.password
                $.ajax({
                    type: "GET",
                    url: "/portal/userLogin",
                    data: {userName:userName, password:userPass},
                    dataType: "json",
                    success: function(data){
                        if (data.status == 0){
                            window.location.href='../templates/index.html';
                        }else {
                            var layer = layui.layer;
                            layer.open({
                                title: '提示'
                                ,content: data.msg
                            });
                        }
                    }
                });
                return false;
            });
        });
    </script>
</div>
</body>
</html>